package com.sc.nft.feign;

import com.sc.nft.dto.*;
import com.sc.nft.sup.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.validation.Valid;

@FeignClient("nft-chain")
@RequestMapping("/chain")
public interface ChainFeignClient {

    /**
     * 上链
     * @param request
     * @return
     */
    @PostMapping(value = "/mint", produces = MediaType.APPLICATION_JSON_VALUE)
    Result mint(@Valid @RequestBody MintDTO request);

    /**
     * 转增
     * @param request
     * @return
     */
    @PostMapping(value = "/transfer", produces = MediaType.APPLICATION_JSON_VALUE)
    Result transfer(@Valid @RequestBody TransferDTO request);

    /**
     * 销毁
     * @param request
     * @return
     */
    @PostMapping(value = "/burn", produces = MediaType.APPLICATION_JSON_VALUE)
    Result burn(@Valid @RequestBody BurnDTO request);
}
